package com.itheima.dao;

import com.itheima.pojo.WebVisit;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

public interface WebVisitMapper extends Mapper<WebVisit> {
    @Select("select count(tip.ip) uv from (SELECT ip FROM t_web_visit where create_time BETWEEN #{startTime} and #{endTime} GROUP BY ip) tip")
    Integer getUv(@Param("startTime") String startTime, @Param("endTime") String endTime);

    @Select("SELECT count(uid) pv FROM t_web_visit where create_time BETWEEN #{startTime} and #{endTime}")
    Integer getPv(@Param("startTime") String startTime,@Param("endTime") String endTime);
}
